package com.hw.dagl.controller;

import java.text.ParseException;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.hw.dagl.model.Dagl_T_Cjtj;
import com.hw.dagl.model.Sys_User;
import com.hw.dagl.service.CxtjService;
import com.hw.dao.utils.ControllerUtil;



/**
 * @author Administrator
 * 影像信息
 */
@Controller
public class cxtjController extends BaseController{
	@Resource
	
	private CxtjService cxtjServiceImpl;
	/**
	 * 跳转采集统计页面
	 */
	@RequestMapping(method=RequestMethod.GET)
	public String cjtj(HttpServletResponse response){
		return "cxtj/cjtj";
	}
	
	/**
	 * 跳转驾驶证采集统计页面
	 */
	@RequestMapping(method=RequestMethod.GET)
	public String jsrcjtj(HttpServletResponse response){
		return "cxtj/jsrcjtj";
	}
	
	
	/**
	 * 跳转机动车采集统计页面
	 */
	@RequestMapping(method=RequestMethod.GET)
	public String jdccjtj(HttpServletResponse response){
		return "cxtj/jdccjtj";
	}
	
	/**
	 * 采集统计汇总
	 */
	@RequestMapping(method=RequestMethod.POST)
	public void findcjtj(HttpServletRequest request,HttpServletResponse response,String startTime,String endTime){
		Sys_User user = (Sys_User) request.getSession().getAttribute("user");//得到当前登录角色
		List<Dagl_T_Cjtj> list = cxtjServiceImpl.findshtjTotal(startTime,endTime,user.getGlbm());
		ControllerUtil.renderJson(response, list, "encoding:UTF-8","no-cache:false");
	}
	
	
	/**
	 * 驾驶证采集统计汇总
	 */
	@RequestMapping(method=RequestMethod.POST)
	public void findjszcjtj(HttpServletRequest request,HttpServletResponse response,String startTime,String endTime){
		List<Dagl_T_Cjtj> list = cxtjServiceImpl.findjszcjtjTotal(startTime,endTime);
		ControllerUtil.renderJson(response, list, "encoding:UTF-8","no-cache:false");
	}
	
	
	/**
	 * 机动车采集统计汇总
	 */
	@RequestMapping(method=RequestMethod.POST)
	public void findjdccjtj(HttpServletRequest request,HttpServletResponse response,String startTime,String endTime){
		List<Dagl_T_Cjtj> list = cxtjServiceImpl.findjdccjtjTotal(startTime,endTime);
		ControllerUtil.renderJson(response, list, "encoding:UTF-8","no-cache:false");
	}
	/**
	 * 跳转工作量统计页面
	 */
	@RequestMapping(method=RequestMethod.GET)
	public String gzl(HttpServletResponse response){
		return "cxtj/gzl";
	}
	/**
	 * 工作量统计
	 */
	@RequestMapping(method=RequestMethod.POST)
	public void findgzl(HttpServletRequest request,HttpServletResponse response,String startTime,String endTime) throws ParseException {
		List<Dagl_T_Cjtj> list = cxtjServiceImpl.findgzl(startTime,endTime);
		ControllerUtil.renderJson(response, list, "encoding:UTF-8","no-cache:false");
	}
	
	/**
	 * 跳转接口未上传统计页面
	 */
	@RequestMapping(method=RequestMethod.GET)
	public String notuploadcount(HttpServletResponse response){
		return "cxtj/NotUploadCount";
	}
	
	/**
	 * 接口未上传统计
	 */
	@RequestMapping(method=RequestMethod.POST)
	public void findNotUploadcount(HttpServletRequest request,HttpServletResponse response,String startTime,String endTime) throws ParseException {
		List<Dagl_T_Cjtj> list = cxtjServiceImpl.findNotUploadcount(startTime,endTime);
		ControllerUtil.renderJson(response, list, "encoding:UTF-8","no-cache:false");
	}
}
